type Method = "GET" | "POST" | "PUT" | "DELETE" | "post" | "get"
type ResponseType =
  | "arraybuffer"
  | "blob"
  | "document"
  | "json"
  | "text"
  | "stream"

interface AxiosRequest {
  baseURL?: string
  url: string
  data?: any
  params?: any
  method?: Method
  headers?: any
  timeout?: number
  responseType?: ResponseType
  formdata?: boolean //是否formdata数据，默认json数据
  hideLoading?: boolean //是否隐藏loading，默认有loading
  openResponese?: boolean //是否返回全部响应，默认返回响应的data对象
}

interface AxiosResponse {
  data: any
  headers: any
  request?: any
  status: number
  statusText: string
  config: AxiosRequest
}

interface CustomResponse {
  readonly status: boolean
  readonly message: string
  data: any
  origin?: any
}

interface GetDemo {
  id: number
  str: string
}

interface PostDemo {
  id: number
  list: Array<{
    id: number
    version: number
  }>
}

export type {
  Method,
  ResponseType,
  AxiosRequest,
  AxiosResponse,
  CustomResponse,
  GetDemo,
  PostDemo,
}
